package com.exercise.memberscheduling.security;

import lombok.Data;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;

/**
 * @Author:STY
 * @Decription:securoty用户接口实现类
 */
@Data
@ToString
public class UserLogin implements UserDetails {
    private String id = "admin";//管理员id
    private String password;//密码
    private String authority = "admin";//管理员
    private List<GrantedAuthority> authorities;//权限

    @Override
    public String getUsername() {
        return id;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
